<script setup>

import {ElMessage} from "element-plus";
import Clipboard from 'clipboard';

const open = () => {
  const ws = new WebSocket("ws://fun.free.idcfengye.com/music/ws/together")
  ws.onopen = function () {
    ElMessage.success("OK")
  }
}
const copy = () => {
    const textToCopy = '要复制的文本内171容';
    try {
      navigator.clipboard.writeText(textToCopy);
      console.log('复制成功');
      ElMessage.success('复制成功')
    } catch (err) {
      console.error('复制失败：', err);
      ElMessage.error('复制失败')
    }
}
</script>


<template>
<div>
  <el-button id="11" @click="open" >click</el-button>
  <el-button @click="copy" >copy</el-button>

</div>

</template>




<style scoped>

</style>


